<template>
	<view class="page">
		<view class="p-name">
			<view class="flex-row justify-between items-center section" @click="navTo('/pages/center/info')">
			  <view class="flex-row items-center space-x-15">
			    <image
			      class="image_4"
				  mode="aspectFill"
			      :src="userInfo.company_image"
			    />
			    <view class="flex-col items-start space-y-23">
			      <text class="font_2">{{userInfo.company_name}}</text>
			      <text class="text_3">{{userInfo.mobile}}</text>
			    </view>
			  </view>
			  <image
			    class="image_5"
			    src="/static/center-r.png"
			  />
			</view>
		</view>
		<view class="p-price">
			<view class="flex-col section_2 space-y-25">
			  <text class="self-start font_1 text_4">平台收益</text>
			  <view class="flex-row justify-between items-center">
			    <view class="flex-row align-center" @click="navTo('/pages/income/record')">
			      <text class="text_5">{{userInfo.money}}</text>
			      <text class="font_1 text_7">明细</text>
			    </view>
			    <view class="flex-col justify-start items-center text-wrapper" @click="navTo('/pages/income/withdrawl')">
					<text class="text_6">提现</text>
				</view>
			  </view>
			</view>
		</view>
		
	    <view class="p-entry">
			<view class="inner">
				<view class="flex-row justify-between items-center group_3" @click="navTo('/pages/eva/evas/index')">
				  <text class="font_2 text_8">我的评价</text>
				  <image
					class="image_6 image_7"
					src="/static/arrow-br.png"
				  />
				</view>	
			</view>
			<view class="inner">
				<view class="flex-row justify-between items-center group_3" @click="navTo('/pages/employee/employees/index')">
				  <text class="font_2 text_8">员工管理</text>
				  <image
					class="image_6 image_7"
					src="/static/arrow-br.png"
				  />
				</view>	
				<view class="flex-row justify-between items-center group_3" @click="navTo('/pages/center/kefu')">
				  <text class="font_2 text_8">平台客服</text>
				  <image
					class="image_6 image_7"
					src="/static/arrow-br.png"
				  />
				</view>
				<view class="flex-row justify-between items-center group_3" @click="logout">
				  <text class="font_2 text_8">退出登录</text>
				  <image
					class="image_6 image_7"
					src="/static/arrow-br.png"
				  />
				</view>
				<!-- 
				<view class="flex-row justify-between items-center group_3" style="border: none;">
				   <text class="font_2 text_8">版本号</text>
				   <text class="version">V1.0.1</text>
				</view>	
				 -->
			</view>
		</view>
	</view>
</template>

<script lang="ts">
import {
  reactive,
  toRefs,
  defineComponent, 
  ref,
  // watchEffect,
} from 'vue';
import {onShow, onPullDownRefresh} from "@dcloudio/uni-app";
const center = defineComponent({
	components:{
	},
	props: {
	},
	setup(props: any, ctx: any) {
		const data = reactive({
	
		})
		// watchEffect(()=>{
		// })
		onShow(()=>{
			uni.$store.dispatch('user/getinfo')
		})
		onPullDownRefresh(()=>{
			uni.$store.dispatch('user/getinfo')
			uni.stopPullDownRefresh();
		})
		const logout= async ()=>{
			const {confirm} = await uni.showModal({
				title:'提示',
				content:'确认退出吗？'
			})
			console.log("logout===",confirm)
			if(confirm){
				uni.$store.dispatch('user/logout')
				uni.$this.navTo('/pages/index/index',{},{type:'replaceAll'})
			}
		}
		return {
			...toRefs(data),
			logout,
		};
	}
})
export default center;
</script>

<style lang="scss">
page{
	background-color: #f7f7f7;
}
.p-name{
	padding: 0 30rpx;
	margin-bottom: 24rpx;
	.section {
	  padding: 30rpx 24rpx 30rpx 30rpx;
	  background-color: #ffffff;
	  border-radius: 10rpx;
	  .space-x-15 {
	    & > view:not(:first-child),
	    & > text:not(:first-child),
	    & > image:not(:first-child) {
	      margin-left: 15rpx;
	    }
	    .image_4 {
	      width: 94rpx;
	      height: 94rpx;
		  border-radius: 94rpx;
	    }
	    .space-y-23 {
	      & > view:not(:first-child),
	      & > text:not(:first-child),
	      & > image:not(:first-child) {
	        margin-top: 23rpx;
	      }
	      .font_2 {
	        font-size: 32rpx;
	        font-family: PingFang;
	        color: #333333;
	      }
	      .text_3 {
	        color: #333333;
	        font-size: 26rpx;
	        font-family: PingFang;
	      }
	    }
	  }
	  .image_5 {
	    width: 20rpx;
	    height: 36rpx;
	  }
	}
}
.p-price{
	padding: 0 30rpx;
	margin-bottom: 24rpx;
	.section_2 {
	  padding: 38rpx 29rpx 55rpx;
	  background-color: #256ae5;
	  border-radius: 10rpx;
	  .font_1 {
	    font-size: 24rpx;
	    font-family: PingFang;
	    color: #ffffff;
	  }
	  .text_5 {
	    color: #ffffff;
	    font-size: 54rpx;
	    font-family: PingFang;
	  }
	  .text_7 {
		margin-left: 20rpx;
	    line-height: 26rpx;
	    text-decoration: underline;
	  }
	  .text-wrapper {
	    // padding: 16rpx 0;
	    border-radius: 27rpx;
	    // background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/62a039a05a7e3f0310646cb4/62a0461551588f0011f85200/16753181036397062223.png');
	    // background-size: 100% 100%;
	    // background-repeat: no-repeat;
		border: 2rpx solid #fff;
	    width: 123rpx;
	    height: 58rpx;
	    .text_6 {
	      color: #ffffff;
	      font-size: 28rpx;
	      font-family: PingFang;
		  line-height: 52rpx;
	    }
	  }
	}
	.space-y-25 {
	  & > view:not(:first-child),
	  & > text:not(:first-child),
	  & > image:not(:first-child) {
	    margin-top: 25rpx;
	  }
	}
}
.p-entry{
	padding: 0 30rpx;
	.inner{
		background-color: #fff;
		border-radius: 10rpx;
	}
	.version{
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}
	.group_3 {
	  padding: 40rpx 31rpx;
	  border-bottom: solid 2rpx #0000000f;
	  .font_2 {
	    font-size: 30rpx;
	    font-family: PingFang;
	    color: #333333;
		font-weight: bold;
	  }
	  .image_6 {
	    margin-right: 4rpx;
	    width: 26rpx;
	    height: 26rpx;
	  }
	  .image_7 {
	    margin-right: 3rpx;
	  }
	}
}
</style>
